﻿#ifndef LOGINDLG_H
#define LOGINDLG_H

#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QGridLayout>
class LoginDlg : public QDialog
{
	Q_OBJECT

public:
	LoginDlg(QWidget *parent);
	~LoginDlg();
	const QString& GetUser();
	QString& GetPasswd();
	QString& GetDataBaseName();
	QString& GetIp();
	//表示用户点击的是取消还是登录
	bool isLogin;
private slots:
	void Slot_Login();
	void Slot_LogOut();
private:
	void SetDialogBackGround();

	void CreateLayout();
	void CreateLabel();
	void CreateLineEdit();
	void CreateButton();


	//
	QLabel *m_lableUser;
	QLabel *m_labelPasswd;
	QLabel *m_labelDatabase;
	QLabel *m_labelIP;

	QLineEdit *m_editUser;
	QLineEdit *m_editPasswd;
	QLineEdit *m_editDatabase;
	QLineEdit *m_editIp;

	QPushButton *m_buttonLogin;
	QPushButton *m_buttonCanel;

	QGridLayout *m_layout;

	//用于获取输入的信息
	QString m_strUser;
	QString m_strPasswd;
	QString m_strDataBase;
	QString m_strIp;
};

#endif // LOGINDLG_H
